
#pragma once

#include "../Main.h"

enum Controller_ModalDialogType
{
    DIALOGTYPE_OKONLY,
    DIALOGTYPE_OKCANCEL,
    DIALOGTYPE_YESNO,
    DIALOGTYPE_YESNOCANCEL
};

enum Controller_ModalDialogResult
{
    DIALOGRESULT_OK,
    DIALOGRESULT_CANCEL,
    DIALOGRESULT_YES,
    DIALOGRESULT_NO
};

class Widget;
class DialogPanel;

class Controller_ModalDialog
{

	public:

		static void Initialise();
		static void Update();
		static void Shutdown();

		static void Show( const char* const szMessage, const Controller_ModalDialogType eType );
		static bool IsActive() { return ( s_pxDialogPanel != 0 ); }
		static void SetCallback( void( * pfnCallback )( const Controller_ModalDialogResult ) ) { s_pfnCallback = pfnCallback; }

	private:

		static void OKCallback( void* pUserData );
		static void CancelCallback( void* pUserData );
		static void YesCallback( void* pUserData );
		static void NoCallback( void* pUserData );

		static void Destroy();

		static void( * s_pfnCallback )( const Controller_ModalDialogResult );

		static DialogPanel* s_pxDialogPanel;
		static bool s_bDestroy;
};

// eof
